package com.yugao.fintech.draper.gateway.configure;

import com.yugao.fintech.draper.gateway.handler.GatewayIndexHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.web.reactive.function.server.RequestPredicates;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.RouterFunctions;
import org.springframework.web.reactive.function.server.ServerResponse;

@Configuration(proxyBeanMethods = false)
public class SpringDocConfiguration {

	@Bean
	public RouterFunction<ServerResponse> docIndexHandler(GatewayIndexHandler gatewayIndexHandler) {
		return RouterFunctions.route(RequestPredicates.GET("/")
						.and(RequestPredicates.accept(MediaType.ALL)), gatewayIndexHandler);
	}
}
